import time
from Lian8_26.Base import Base
from selenium.webdriver.common.by import By
class Page(Base):
    login_loc = (By.XPATH, '/html/body/div[1]/div/div[2]/ul/li[1]/a')

    def login(self):
        self.click(self.login_loc)

    dy1_loc = (By.CLASS_NAME, 'reg-new')

    def dy1(self):
        return self.text(self.dy1_loc)

    username_loc = (By.NAME, 'username')

    def username(self):
        self.send_keys(self.username_loc, '13811033962')

    password_loc = (By.NAME, 'password')

    def password(self):
        self.send_keys(self.password_loc, '123456')

    loginbtn_loc = (By.XPATH, '//*[@id="theForm"]/div[5]/a')

    def loginbtn(self):
        self.click(self.loginbtn_loc)

    dy2_loc = (By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a')

    def dy2(self):
        return self.text(self.dy2_loc)

    def luoji_A3mall(self):
        self.open_url('http://10.59.9.12:7001/')
        self.login()
        print(self.dy1())
        self.username()
        self.password()
        time.sleep(10)
        self.loginbtn()
        time.sleep(5)
        print(self.dy2())